function Slide(parent, x,y,w,h)
	local slide = Widget(parent, x, y, w, h)
	slide:Show(true)
	slide._x = 0
	slide.active = 1
	slide.pad_x = 40
	slide["Paint"] = function (self, g)
		local w, h = self:Size()
		g:SetColor(0xFF000000)
		g:FillRect(0, 0, w, h)
		if self._x > 0 then 
			if self.active - 1 >= 1 then
				g:DrawImage(self.images[self.active - 1], self._x - w, 0, w, h)
			end	
		end
		g:DrawImage(self.images[self.active], self._x, 0, w, h)
		if self._x < 0 then 
			if self.active < #self.images then
				g:DrawImage(self.images[self.active + 1], w + self._x, 0, w, h)
			end	
		end
		g:SetColor(0x80000000)
		g:FillRoundRect(self.pad_x, h - 24, w - self.pad_x - self.pad_x, 14, 8)
		local interval = 32
		local pos = (w - (#self.images - 1) * interval) / 2
		for index = 1, #self.images do
			if index == self.active then
				g:SetColor(0xFFFFFFFF)
			else
				g:SetColor(0x80FFFFFF)
			end
			g:FillEllipse(pos, h - 22 , 10, 10)
			pos = pos + interval
		end
	end

	slide["Slide"] = function(self, x, y)
		local w, h = self:Size()
		if x == 0 and y == 0 then
			if self._x < -w / 2 then
				self.active = self.active + 1
			elseif self._x > w / 2 then
				self.active = self.active - 1
			end
			self._x = 0
		else 
			if self.active == 1 and x < - w / 4 then
				return
			end
			if self.active == #self.images and x > w / 4 then
				return
			end
			self._x = -x
		end
		self:Repaint()
	end
	return slide
end